<?php
// Tim'Roster
// Copyright (c) 2011 Nicolas Nallet <aspgic2@gmail.com>
//
// This file is part of Tim'Roster.
//
// Tim'Roster is free software; you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation; either version 3 of the License, or
// (at your option) any later version.
//
// Tim'Roster is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA

$xml_config = simplexml_load_file('config.xml');

include_once ($_SERVER["DOCUMENT_ROOT"].$xml_config->roster_root_directory.'/web_ui/common_function.php');

function render_guild_log_book_entry(Logbook $logbook){



    $column_array = array();
    $column_array[] = Language::get_instance()->get_label(Language::get_instance()->get_label('lb_type'));
    $column_array[] = Language::get_instance()->get_label(Language::get_instance()->get_label('lb_description'));
    $column_array[] = Language::get_instance()->get_label(Language::get_instance()->get_label('lb_date'));

    $log_list_table = generate_html_table_header($column_array, 450, true);


    $log_array = $logbook->get_log_array();

    if (isset($log_array)){
        foreach($log_array as $log){
            $log_list_table .= '<tr>';
            $log_list_table .= '<td>'.$log->get_type().'</td>';
            $log_list_table .= '<td>'.$log->get_text().'</td>';
            $log_list_table .= '<td>'.$log->get_date().'</td>';
            $log_list_table .= '</tr>';
        }
    }

    $log_list_table .= generate_html_table_footer();

    return $log_list_table;
}

?>
